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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: G = None
        self.x: C = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: G = None
        self.x: C = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

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

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