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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: F = 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.z: B = None
        self.v: A = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: A = None
        self.s: D = None
        self.x: G = None
        self.t: A = None
        self.txt = txt

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

b = A("b")
m = B("m")
n = C("n")
e = D("e")
l = E("l")
f = F("f")
d = G("d")
i = A("i")
j = E("j")
c = A("c")

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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: F = 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.z: B = None
        self.v: A = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: A = None
        self.s: D = None
        self.x: G = None
        self.t: A = None
        self.txt = txt

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

b = A("b")
m = B("m")
n = C("n")
e = D("e")
l = E("l")
f = F("f")
d = G("d")
i = A("i")
j = E("j")
c = A("c")

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