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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: F = None
        self.t: E = None
        self.z: A = None
        self.txt = txt

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

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

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

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

a = A("a")
l = B("l")
j = C("j")
e = D("e")
g = E("g")
m = F("m")

a.u = e
a.y = g
a.o = m
l.s = a
l.z = a
l.v = m
l.t = g
j.x = a
e.t = a
e.r = l
g.r = e
g.y = e
m.z = e
m.u = e
m.x = e
m.y = g
assert g.r.r.t.y.r.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: E = None
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: F = None
        self.t: E = None
        self.z: A = None
        self.txt = txt

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

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

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

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

a = A("a")
l = B("l")
j = C("j")
e = D("e")
g = E("g")
m = F("m")

a.u = e
a.y = g
a.o = m
l.s = a
l.z = a
l.v = m
l.t = g
j.x = a
e.t = a
e.r = l
g.r = e
g.y = e
m.z = e
m.u = e
m.x = e
m.y = g
assert g.r.r.t.y.r.txt == "l"