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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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