class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: E = None
        self.x: H = None
        self.p: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: F = None
        self.z: C = None
        self.s: A = None
        self.v: G = None
        self.r: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: H = None
        self.x: D = None
        self.v: A = None
        self.w: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: F = None
        self.z: C = None
        self.s: A = None
        self.v: G = None
        self.r: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: H = None
        self.x: D = None
        self.v: A = None
        self.w: B = None
        self.txt = txt

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

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

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

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