class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: A = None
        self.w: G = None
        self.z: F = None
        self.x: D = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: G = None
        self.w: G = None
        self.t: B = None
        self.r: A = None
        self.o: A = None
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: G = None
        self.y: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: C = None
        self.y: G = None
        self.z: A = None
        self.q: B = None
        self.p: D = None
        self.r: B = None
        self.txt = txt

l = A("l")
j = B("j")
f = C("f")
i = D("i")
g = E("g")
c = F("c")
k = G("k")
m = B("m")
e = G("e")
n = A("n")

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: A = None
        self.w: G = None
        self.z: F = None
        self.x: D = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: G = None
        self.w: G = None
        self.t: B = None
        self.r: A = None
        self.o: A = None
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: G = None
        self.y: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: C = None
        self.y: G = None
        self.z: A = None
        self.q: B = None
        self.p: D = None
        self.r: B = None
        self.txt = txt

l = A("l")
j = B("j")
f = C("f")
i = D("i")
g = E("g")
c = F("c")
k = G("k")
m = B("m")
e = G("e")
n = A("n")

l.u = i
j.q = i
j.x = i
j.r = n
j.w = e
j.z = c
j.o = c
f.p = n
f.r = n
f.o = n
f.v = e
f.w = k
f.t = j
f.y = m
i.s = n
i.o = e
i.y = f
g.t = f
g.z = f
g.u = l
g.v = l
g.q = k
g.y = n
g.w = c
c.w = k
c.q = f
c.x = j
c.p = g
k.v = c
k.x = f
k.y = e
k.z = n
k.q = m
k.p = i
k.r = j
m.q = i
m.x = i
m.r = n
m.w = e
m.z = c
m.o = c
e.v = c
e.x = f
e.y = k
e.z = l
e.q = j
e.r = j
e.p = i
n.u = i
assert m.x.o.z.u.o.y.p.s.u.y.txt == "f"