class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: F = None
        self.r: G = None
        self.u: D = None
        self.q: B = None
        self.o: C = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: H = None
        self.q: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: G = None
        self.y: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: H = None
        self.q: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: G = None
        self.y: F = None
        self.txt = txt

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

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