class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: C = None
        self.q: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: E = None
        self.t: F = None
        self.w: A = None
        self.p: E = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: B = None
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: B = None
        self.u: A = None
        self.r: B = None
        self.p: A = None
        self.s: A = None
        self.txt = txt

m = A("m")
i = B("i")
b = C("b")
j = D("j")
h = E("h")
c = F("c")
g = A("g")
d = B("d")
n = F("n")

m.y = b
m.o = b
m.q = n
i.y = m
b.s = h
j.x = d
j.s = h
j.p = h
j.t = c
j.w = m
j.y = m
h.r = i
h.p = d
h.o = m
c.x = h
c.v = i
c.r = i
c.u = g
c.p = m
c.s = m
g.y = b
g.o = b
g.q = n
d.y = m
n.x = h
n.v = d
n.u = g
n.p = g
n.r = i
n.s = m
assert h.o.y.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: C = None
        self.q: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: E = None
        self.t: F = None
        self.w: A = None
        self.p: E = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: B = None
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: B = None
        self.u: A = None
        self.r: B = None
        self.p: A = None
        self.s: A = None
        self.txt = txt

m = A("m")
i = B("i")
b = C("b")
j = D("j")
h = E("h")
c = F("c")
g = A("g")
d = B("d")
n = F("n")

m.y = b
m.o = b
m.q = n
i.y = m
b.s = h
j.x = d
j.s = h
j.p = h
j.t = c
j.w = m
j.y = m
h.r = i
h.p = d
h.o = m
c.x = h
c.v = i
c.r = i
c.u = g
c.p = m
c.s = m
g.y = b
g.o = b
g.q = n
d.y = m
n.x = h
n.v = d
n.u = g
n.p = g
n.r = i
n.s = m
assert h.o.y.s.r.txt == "i"