class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: E = None
        self.r: C = None
        self.q: E = None
        self.z: C = None
        self.t: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: D = None
        self.z: A = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: D = None
        self.z: A = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

d.s = l
d.o = l
d.q = l
d.r = a
d.z = a
d.t = g
j.q = c
j.p = g
j.z = d
j.w = a
a.x = d
a.q = l
g.u = j
g.r = d
g.w = d
g.p = a
g.x = l
g.s = c
l.r = a
c.q = j
assert g.u.p.s.q.w.x.txt == "d"