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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

l.r = i
j.t = a
j.u = h
i.p = j
i.t = j
h.o = j
h.s = b
f.s = l
f.q = l
f.x = h
f.z = j
f.u = b
n.x = g
n.w = j
n.v = l
n.s = l
c.p = j
c.t = j
g.x = n
g.w = j
g.v = l
g.s = l
b.o = j
b.s = h
a.x = n
a.w = j
a.v = l
a.s = l
assert j.u.o.u.o.u.s.s.s.txt == "b"