class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: E = None
        self.u: D = None
        self.t: D = None
        self.z: H = None
        self.y: E = None
        self.v: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: H = None
        self.o: H = None
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: B = None
        self.q: A = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: C = None
        self.x: G = None
        self.o: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: E = None
        self.u: D = None
        self.t: D = None
        self.z: H = None
        self.y: E = None
        self.v: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: H = None
        self.o: H = None
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: B = None
        self.q: A = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: C = None
        self.x: G = None
        self.o: A = None
        self.txt = txt

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

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