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

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

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: A = None
        self.x: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: E = None
        self.txt = txt

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

h.o = k
d.z = i
d.q = c
d.t = k
d.u = m
i.v = h
g.s = c
g.r = h
g.x = i
m.t = h
m.y = k
m.u = g
c.q = m
c.s = m
j.q = m
j.s = m
k.z = i
k.q = c
k.t = d
k.u = m
l.q = m
l.s = m
assert i.v.o.u.t.o.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: A = None
        self.x: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: E = None
        self.txt = txt

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

h.o = k
d.z = i
d.q = c
d.t = k
d.u = m
i.v = h
g.s = c
g.r = h
g.x = i
m.t = h
m.y = k
m.u = g
c.q = m
c.s = m
j.q = m
j.s = m
k.z = i
k.q = c
k.t = d
k.u = m
l.q = m
l.s = m
assert i.v.o.u.t.o.u.u.txt == "g"