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

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

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

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

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

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

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

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

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

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

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

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

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

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

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