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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: C = None
        self.r: G = None
        self.v: F = None
        self.t: B = None
        self.y: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: F = None
        self.o: E = None
        self.r: B = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: G = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: C = None
        self.r: G = None
        self.v: F = None
        self.t: B = None
        self.y: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: F = None
        self.o: E = None
        self.r: B = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: G = None
        self.txt = txt

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

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