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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

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

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

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

h.s = j
h.r = j
h.y = l
m.w = g
m.t = h
m.z = h
g.u = n
e.q = h
e.x = l
e.o = l
e.r = n
e.v = g
j.s = n
j.x = a
n.o = j
n.t = g
n.q = m
a.s = n
a.x = j
l.q = h
l.x = e
l.o = e
l.r = n
l.v = g
assert h.r.x.x.s.q.w.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: D = None
        self.r: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

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

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

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

h.s = j
h.r = j
h.y = l
m.w = g
m.t = h
m.z = h
g.u = n
e.q = h
e.x = l
e.o = l
e.r = n
e.v = g
j.s = n
j.x = a
n.o = j
n.t = g
n.q = m
a.s = n
a.x = j
l.q = h
l.x = e
l.o = e
l.r = n
l.v = g
assert h.r.x.x.s.q.w.u.o.txt == "j"