class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: E = None
        self.y: E = None
        self.p: A = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: A = None
        self.w: C = None
        self.txt = txt

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

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

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

j.s = g
g.x = j
g.v = j
g.w = c
g.s = m
g.u = n
c.s = a
c.v = n
c.y = n
c.p = j
c.w = l
m.v = n
m.y = j
m.w = c
n.z = c
n.t = a
l.x = j
l.q = c
a.z = c
a.t = n
assert m.w.s.t.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: E = None
        self.y: E = None
        self.p: A = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: A = None
        self.w: C = None
        self.txt = txt

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

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

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

j.s = g
g.x = j
g.v = j
g.w = c
g.s = m
g.u = n
c.s = a
c.v = n
c.y = n
c.p = j
c.w = l
m.v = n
m.y = j
m.w = c
n.z = c
n.t = a
l.x = j
l.q = c
a.z = c
a.t = n
assert m.w.s.t.z.txt == "c"