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

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: F = None
        self.v: D = None
        self.s: A = None
        self.p: B = None
        self.r: D = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: D = None
        self.r: E = None
        self.y: B = None
        self.txt = txt

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

g.t = c
g.u = d
g.z = k
g.r = m
l.z = h
f.p = k
c.o = m
c.s = m
c.u = d
c.v = b
c.r = b
c.p = l
h.r = g
h.o = d
d.s = l
d.y = l
d.x = b
d.r = h
k.r = m
k.o = d
m.t = b
m.u = d
m.z = h
m.r = g
b.o = m
b.s = m
b.u = d
b.v = c
b.r = c
b.p = l
assert b.u.x.u.y.z.o.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: F = None
        self.z: E = None
        self.r: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: F = None
        self.v: D = None
        self.s: A = None
        self.p: B = None
        self.r: D = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: D = None
        self.r: E = None
        self.y: B = None
        self.txt = txt

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

g.t = c
g.u = d
g.z = k
g.r = m
l.z = h
f.p = k
c.o = m
c.s = m
c.u = d
c.v = b
c.r = b
c.p = l
h.r = g
h.o = d
d.s = l
d.y = l
d.x = b
d.r = h
k.r = m
k.o = d
m.t = b
m.u = d
m.z = h
m.r = g
b.o = m
b.s = m
b.u = d
b.v = c
b.r = c
b.p = l
assert b.u.x.u.y.z.o.y.z.txt == "h"