class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: A = None
        self.y: D = None
        self.w: E = None
        self.o: F = None
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: B = None
        self.s: B = None
        self.txt = txt

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

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

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

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

d = A("d")
l = B("l")
e = C("e")
m = D("m")
f = E("f")
k = F("k")
a = G("a")
b = C("b")
h = F("h")

d.o = l
l.q = k
l.o = k
l.z = d
l.y = m
l.t = m
l.w = f
e.q = d
e.o = l
e.s = l
m.u = d
m.q = d
m.v = f
m.y = b
f.x = m
f.t = l
k.r = m
k.z = m
k.q = m
k.x = m
k.t = d
a.x = f
a.r = e
b.q = d
b.o = l
b.s = l
h.r = m
h.z = m
h.q = m
h.x = m
h.t = d
assert k.t.o.z.o.o.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: A = None
        self.y: D = None
        self.w: E = None
        self.o: F = None
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: B = None
        self.s: B = None
        self.txt = txt

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

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

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

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

d = A("d")
l = B("l")
e = C("e")
m = D("m")
f = E("f")
k = F("k")
a = G("a")
b = C("b")
h = F("h")

d.o = l
l.q = k
l.o = k
l.z = d
l.y = m
l.t = m
l.w = f
e.q = d
e.o = l
e.s = l
m.u = d
m.q = d
m.v = f
m.y = b
f.x = m
f.t = l
k.r = m
k.z = m
k.q = m
k.x = m
k.t = d
a.x = f
a.r = e
b.q = d
b.o = l
b.s = l
h.r = m
h.z = m
h.q = m
h.x = m
h.t = d
assert k.t.o.z.o.o.t.o.txt == "l"