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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: A = None
        self.w: B = None
        self.p: B = None
        self.x: B = None
        self.y: F = None
        self.txt = txt

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

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

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

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

i.r = m
i.u = g
i.z = b
i.o = j
b.s = g
b.z = g
b.v = e
b.y = e
b.x = l
j.o = b
j.w = b
j.p = b
j.x = b
j.u = i
j.y = g
e.u = b
e.w = j
l.x = g
g.s = j
m.r = i
m.u = g
m.z = b
m.o = j
assert m.z.x.x.s.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: F = None
        self.z: B = None
        self.o: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: A = None
        self.w: B = None
        self.p: B = None
        self.x: B = None
        self.y: F = None
        self.txt = txt

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

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

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

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

i.r = m
i.u = g
i.z = b
i.o = j
b.s = g
b.z = g
b.v = e
b.y = e
b.x = l
j.o = b
j.w = b
j.p = b
j.x = b
j.u = i
j.y = g
e.u = b
e.w = j
l.x = g
g.s = j
m.r = i
m.u = g
m.z = b
m.o = j
assert m.z.x.x.s.x.x.txt == "l"