class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: F = None
        self.u: E = None
        self.t: C = None
        self.s: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

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

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

f.r = b
f.y = b
f.u = c
f.t = a
f.s = h
m.y = c
m.z = a
m.x = f
m.t = f
a.z = n
n.t = h
n.s = b
n.x = j
n.r = f
h.o = c
h.s = f
h.r = b
b.r = f
b.y = a
c.o = h
c.s = f
c.r = b
j.t = c
j.s = b
j.x = n
j.r = f
l.y = h
l.z = a
l.x = f
l.t = f
assert h.s.s.s.s.s.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: F = None
        self.u: E = None
        self.t: C = None
        self.s: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

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

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

f.r = b
f.y = b
f.u = c
f.t = a
f.s = h
m.y = c
m.z = a
m.x = f
m.t = f
a.z = n
n.t = h
n.s = b
n.x = j
n.r = f
h.o = c
h.s = f
h.r = b
b.r = f
b.y = a
c.o = h
c.s = f
c.r = b
j.t = c
j.s = b
j.x = n
j.r = f
l.y = h
l.z = a
l.x = f
l.t = f
assert h.s.s.s.s.s.u.r.txt == "b"