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

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: E = None
        self.y: C = None
        self.u: C = None
        self.t: B = None
        self.o: B = None
        self.txt = txt

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

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

h = A("h")
b = B("b")
e = C("e")
a = D("a")
j = E("j")
d = F("d")

h.s = e
h.r = b
b.s = h
e.y = h
e.w = j
e.r = j
e.u = d
e.z = d
e.o = b
a.w = j
a.r = j
a.y = e
a.u = e
a.t = b
a.o = b
j.o = b
j.s = h
j.w = d
d.z = a
d.u = a
d.s = h
assert b.s.s.o.s.r.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: E = None
        self.y: C = None
        self.u: C = None
        self.t: B = None
        self.o: B = None
        self.txt = txt

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

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

h = A("h")
b = B("b")
e = C("e")
a = D("a")
j = E("j")
d = F("d")

h.s = e
h.r = b
b.s = h
e.y = h
e.w = j
e.r = j
e.u = d
e.z = d
e.o = b
a.w = j
a.r = j
a.y = e
a.u = e
a.t = b
a.o = b
j.o = b
j.s = h
j.w = d
d.z = a
d.u = a
d.s = h
assert b.s.s.o.s.r.s.txt == "h"