class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: E = None
        self.y: C = None
        self.w: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: D = None
        self.u: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: D = None
        self.q: D = None
        self.z: B = None
        self.t: D = None
        self.txt = txt

a = A("a")
j = B("j")
h = C("h")
d = D("d")
l = E("l")
g = F("g")

a.z = l
a.q = l
a.y = h
a.w = j
j.u = g
j.v = g
j.z = g
j.s = a
j.r = l
j.o = l
h.v = l
h.s = d
h.u = d
d.s = g
d.w = j
d.r = h
l.r = h
l.o = g
g.x = j
g.z = j
g.o = d
g.q = d
g.t = d
assert h.s.r.u.s.x.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: E = None
        self.y: C = None
        self.w: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: D = None
        self.u: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: D = None
        self.q: D = None
        self.z: B = None
        self.t: D = None
        self.txt = txt

a = A("a")
j = B("j")
h = C("h")
d = D("d")
l = E("l")
g = F("g")

a.z = l
a.q = l
a.y = h
a.w = j
j.u = g
j.v = g
j.z = g
j.s = a
j.r = l
j.o = l
h.v = l
h.s = d
h.u = d
d.s = g
d.w = j
d.r = h
l.r = h
l.o = g
g.x = j
g.z = j
g.o = d
g.q = d
g.t = d
assert h.s.r.u.s.x.o.txt == "l"