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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: B = None
        self.z: D = None
        self.y: D = None
        self.txt = txt

h = A("h")
n = B("n")
g = C("g")
a = D("a")
b = E("b")
j = C("j")
f = D("f")

h.s = n
n.t = b
n.w = b
n.r = f
n.x = h
n.u = h
g.y = h
g.p = f
g.w = b
a.x = n
a.s = h
a.o = b
b.w = a
b.z = a
b.o = n
b.y = f
j.y = h
j.p = a
j.w = b
f.x = n
f.s = h
f.o = b
assert g.y.s.u.s.r.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: B = None
        self.z: D = None
        self.y: D = None
        self.txt = txt

h = A("h")
n = B("n")
g = C("g")
a = D("a")
b = E("b")
j = C("j")
f = D("f")

h.s = n
n.t = b
n.w = b
n.r = f
n.x = h
n.u = h
g.y = h
g.p = f
g.w = b
a.x = n
a.s = h
a.o = b
b.w = a
b.z = a
b.o = n
b.y = f
j.y = h
j.p = a
j.w = b
f.x = n
f.s = h
f.o = b
assert g.y.s.u.s.r.s.s.txt == "n"