class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: E = None
        self.txt = txt

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

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

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

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

j = A("j")
l = B("l")
f = C("f")
g = D("g")
e = E("e")
d = E("d")
k = D("k")
m = D("m")
a = A("a")
i = B("i")

j.u = f
j.v = e
l.p = f
l.x = f
l.u = f
l.o = a
l.s = k
f.y = d
g.x = d
g.p = f
e.t = d
d.t = e
k.x = e
k.p = f
m.x = e
m.p = f
a.u = f
a.v = d
i.p = f
i.x = f
i.u = f
i.o = a
i.s = k
assert e.t.t.t.t.t.t.t.t.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: E = None
        self.txt = txt

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

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

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

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

j = A("j")
l = B("l")
f = C("f")
g = D("g")
e = E("e")
d = E("d")
k = D("k")
m = D("m")
a = A("a")
i = B("i")

j.u = f
j.v = e
l.p = f
l.x = f
l.u = f
l.o = a
l.s = k
f.y = d
g.x = d
g.p = f
e.t = d
d.t = e
k.x = e
k.p = f
m.x = e
m.p = f
a.u = f
a.v = d
i.p = f
i.x = f
i.u = f
i.o = a
i.s = k
assert e.t.t.t.t.t.t.t.t.t.t.txt == "e"