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

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: C = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: C = None
        self.p: E = None
        self.txt = txt

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

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

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

g.u = l
g.q = d
g.v = d
g.z = d
g.t = a
g.s = a
l.o = d
l.y = h
l.s = g
l.v = f
a.x = f
a.u = f
h.o = a
h.t = a
h.p = f
f.z = d
f.s = h
f.x = a
f.v = l
f.y = g
d.y = l
assert a.u.x.x.s.txt == "h"