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

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

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

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

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

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

e = A("e")
i = B("i")
d = C("d")
b = D("b")
l = E("l")
h = F("h")
g = D("g")
f = B("f")
n = A("n")

e.o = n
e.r = h
i.t = f
i.u = f
d.x = b
d.q = g
b.w = d
l.q = e
l.r = f
h.u = e
h.w = n
g.w = d
f.t = i
f.u = i
n.o = e
n.r = h
assert f.u.t.t.u.u.t.u.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

e = A("e")
i = B("i")
d = C("d")
b = D("b")
l = E("l")
h = F("h")
g = D("g")
f = B("f")
n = A("n")

e.o = n
e.r = h
i.t = f
i.u = f
d.x = b
d.q = g
b.w = d
l.q = e
l.r = f
h.u = e
h.w = n
g.w = d
f.t = i
f.u = i
n.o = e
n.r = h
assert f.u.t.t.u.u.t.u.t.u.txt == "i"