class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: D = None
        self.t: G = None
        self.r: B = None
        self.z: C = None
        self.y: G = None
        self.u: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: F = None
        self.u: G = None
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: E = None
        self.s: B = None
        self.x: H = None
        self.v: C = None
        self.txt = txt

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

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

b = A("b")
f = B("f")
k = C("k")
j = D("j")
a = E("a")
n = F("n")
d = G("d")
e = H("e")
g = C("g")

b.x = d
b.t = d
b.y = d
b.w = j
b.r = f
b.z = g
b.u = n
f.t = d
k.s = j
k.r = d
j.p = a
j.o = f
a.t = k
a.z = n
a.u = d
a.v = d
n.q = e
n.x = e
n.r = a
n.s = f
n.v = k
d.r = n
e.u = f
e.q = j
g.s = j
g.r = d
assert d.r.v.r.r.s.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: D = None
        self.t: G = None
        self.r: B = None
        self.z: C = None
        self.y: G = None
        self.u: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: F = None
        self.u: G = None
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: E = None
        self.s: B = None
        self.x: H = None
        self.v: C = None
        self.txt = txt

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

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

b = A("b")
f = B("f")
k = C("k")
j = D("j")
a = E("a")
n = F("n")
d = G("d")
e = H("e")
g = C("g")

b.x = d
b.t = d
b.y = d
b.w = j
b.r = f
b.z = g
b.u = n
f.t = d
k.s = j
k.r = d
j.p = a
j.o = f
a.t = k
a.z = n
a.u = d
a.v = d
n.q = e
n.x = e
n.r = a
n.s = f
n.v = k
d.r = n
e.u = f
e.q = j
g.s = j
g.r = d
assert d.r.v.r.r.s.t.r.txt == "n"