class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: G = None
        self.z: B = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: G = None
        self.z: B = None
        self.w: F = None
        self.txt = txt

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

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

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

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

e.r = n
c.o = f
f.t = d
f.s = d
f.w = n
f.z = c
f.u = c
f.y = a
f.v = e
n.s = d
n.q = l
n.z = c
n.w = i
a.t = e
a.o = l
a.r = f
i.t = c
l.u = f
d.t = e
d.o = l
d.r = f
assert a.o.u.t.t.r.q.u.txt == "f"