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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: D = None
        self.u: E = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: D = None
        self.p: C = None
        self.q: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: C = None
        self.t: E = None
        self.y: D = None
        self.o: F = None
        self.txt = txt

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

f = A("f")
a = B("a")
c = C("c")
h = D("h")
d = E("d")
g = F("g")
n = E("n")
i = D("i")

f.r = i
f.z = d
f.o = h
a.t = c
a.s = i
c.w = a
c.t = i
c.u = d
c.z = g
h.s = f
h.x = i
h.q = i
h.p = c
d.p = c
d.x = c
d.t = n
d.y = h
d.o = g
g.x = f
g.o = f
g.p = f
g.u = a
g.s = c
g.y = c
n.p = c
n.x = c
n.t = d
n.y = i
n.o = g
i.s = f
i.x = h
i.q = h
i.p = c
assert c.z.u.s.p.t.p.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: E = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: D = None
        self.u: E = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: D = None
        self.p: C = None
        self.q: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: C = None
        self.t: E = None
        self.y: D = None
        self.o: F = None
        self.txt = txt

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

f = A("f")
a = B("a")
c = C("c")
h = D("h")
d = E("d")
g = F("g")
n = E("n")
i = D("i")

f.r = i
f.z = d
f.o = h
a.t = c
a.s = i
c.w = a
c.t = i
c.u = d
c.z = g
h.s = f
h.x = i
h.q = i
h.p = c
d.p = c
d.x = c
d.t = n
d.y = h
d.o = g
g.x = f
g.o = f
g.p = f
g.u = a
g.s = c
g.y = c
n.p = c
n.x = c
n.t = d
n.y = i
n.o = g
i.s = f
i.x = h
i.q = h
i.p = c
assert c.z.u.s.p.t.p.u.x.txt == "c"