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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: B = None
        self.r: D = None
        self.x: C = None
        self.p: B = None
        self.u: B = None
        self.txt = txt

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

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

j.s = k
j.u = g
j.z = g
j.q = c
j.x = m
m.z = c
m.y = c
m.t = c
m.r = h
m.q = j
d.s = k
d.r = j
c.y = j
a.z = d
a.q = m
a.p = m
a.u = m
a.r = c
a.x = k
g.y = h
l.y = a
h.z = k
h.q = m
h.p = m
h.u = m
h.r = c
h.x = d
k.s = d
k.r = j
assert l.y.z.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: F = None
        self.q: D = None
        self.x: B = None
        self.z: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: B = None
        self.r: D = None
        self.x: C = None
        self.p: B = None
        self.u: B = None
        self.txt = txt

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

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

j.s = k
j.u = g
j.z = g
j.q = c
j.x = m
m.z = c
m.y = c
m.t = c
m.r = h
m.q = j
d.s = k
d.r = j
c.y = j
a.z = d
a.q = m
a.p = m
a.u = m
a.r = c
a.x = k
g.y = h
l.y = a
h.z = k
h.q = m
h.p = m
h.u = m
h.r = c
h.x = d
k.s = d
k.r = j
assert l.y.z.s.r.txt == "j"