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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

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

e.u = n
e.p = n
e.t = h
e.o = h
e.r = h
e.q = f
e.x = m
k.z = l
k.x = f
k.p = a
k.y = a
k.u = a
k.o = m
k.v = h
l.o = h
l.u = k
l.z = k
l.v = e
m.y = n
n.x = h
h.x = i
i.r = n
g.o = h
g.u = k
g.z = k
g.v = e
f.u = n
f.p = n
f.t = h
f.o = h
f.r = h
f.q = e
f.x = a
a.y = n
assert a.y.x.x.r.x.txt == "h"