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

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: E = None
        self.t: F = None
        self.u: E = None
        self.x: H = None
        self.w: G = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: B = None
        self.v: B = None
        self.z: D = None
        self.p: C = None
        self.s: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: F = None
        self.w: B = None
        self.txt = txt

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

a = A("a")
j = B("j")
l = C("l")
k = D("k")
f = E("f")
d = F("d")
e = G("e")
b = H("b")
m = G("m")
c = B("c")

a.r = l
j.t = k
j.u = e
l.p = k
k.p = l
k.v = f
k.u = f
k.t = d
k.s = d
k.x = b
k.w = e
f.u = b
f.o = j
f.v = j
f.s = j
f.z = k
f.p = l
d.x = c
e.x = l
e.t = d
e.w = j
b.u = l
m.x = l
m.t = d
m.w = j
c.t = k
c.u = e
assert d.x.t.p.p.t.x.t.t.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: E = None
        self.t: F = None
        self.u: E = None
        self.x: H = None
        self.w: G = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: B = None
        self.v: B = None
        self.z: D = None
        self.p: C = None
        self.s: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: F = None
        self.w: B = None
        self.txt = txt

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

a = A("a")
j = B("j")
l = C("l")
k = D("k")
f = E("f")
d = F("d")
e = G("e")
b = H("b")
m = G("m")
c = B("c")

a.r = l
j.t = k
j.u = e
l.p = k
k.p = l
k.v = f
k.u = f
k.t = d
k.s = d
k.x = b
k.w = e
f.u = b
f.o = j
f.v = j
f.s = j
f.z = k
f.p = l
d.x = c
e.x = l
e.t = d
e.w = j
b.u = l
m.x = l
m.t = d
m.w = j
c.t = k
c.u = e
assert d.x.t.p.p.t.x.t.t.x.u.txt == "e"