class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: A = None
        self.o: C = None
        self.y: B = None
        self.z: A = None
        self.v: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: A = None
        self.v: C = None
        self.z: E = None
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: B = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: E = None
        self.u: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: B = None
        self.txt = txt

c = A("c")
f = B("f")
b = C("b")
g = D("g")
d = E("d")
m = F("m")
e = E("e")
h = C("h")
k = A("k")
j = D("j")

c.x = k
c.p = k
c.z = k
c.v = k
c.o = b
c.y = f
f.y = d
f.s = c
f.v = b
f.z = e
f.x = g
b.r = f
g.q = f
g.u = f
g.w = h
d.z = f
d.u = f
d.q = e
m.p = b
m.w = f
e.z = f
e.u = f
e.q = d
h.r = f
k.x = c
k.p = c
k.z = c
k.v = c
k.o = h
k.y = f
j.q = f
j.u = f
j.w = h
assert j.w.r.z.u.z.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: A = None
        self.o: C = None
        self.y: B = None
        self.z: A = None
        self.v: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: A = None
        self.v: C = None
        self.z: E = None
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: B = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: E = None
        self.u: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: B = None
        self.txt = txt

c = A("c")
f = B("f")
b = C("b")
g = D("g")
d = E("d")
m = F("m")
e = E("e")
h = C("h")
k = A("k")
j = D("j")

c.x = k
c.p = k
c.z = k
c.v = k
c.o = b
c.y = f
f.y = d
f.s = c
f.v = b
f.z = e
f.x = g
b.r = f
g.q = f
g.u = f
g.w = h
d.z = f
d.u = f
d.q = e
m.p = b
m.w = f
e.z = f
e.u = f
e.q = d
h.r = f
k.x = c
k.p = c
k.z = c
k.v = c
k.o = h
k.y = f
j.q = f
j.u = f
j.w = h
assert j.w.r.z.u.z.q.q.txt == "e"