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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: F = None
        self.v: E = None
        self.q: F = None
        self.r: A = None
        self.z: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: F = None
        self.v: A = None
        self.x: B = None
        self.p: A = None
        self.txt = txt

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

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

l = A("l")
i = B("i")
g = C("g")
j = D("j")
h = E("h")
e = F("e")
f = B("f")
c = C("c")
a = B("a")

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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: F = None
        self.v: E = None
        self.q: F = None
        self.r: A = None
        self.z: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: F = None
        self.v: A = None
        self.x: B = None
        self.p: A = None
        self.txt = txt

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

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

l = A("l")
i = B("i")
g = C("g")
j = D("j")
h = E("h")
e = F("e")
f = B("f")
c = C("c")
a = B("a")

l.y = h
i.v = h
i.r = h
i.u = e
g.u = l
g.r = l
g.y = e
g.q = e
g.v = h
g.z = i
j.z = e
j.w = e
j.v = l
j.p = l
j.x = i
h.w = f
e.z = h
e.y = l
e.v = a
e.p = c
e.s = j
e.o = j
f.v = h
f.r = h
f.u = e
c.u = l
c.r = l
c.y = e
c.q = e
c.v = h
c.z = f
a.v = h
a.r = h
a.u = e
assert e.p.z.u.p.y.y.y.w.v.txt == "h"