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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: H = None
        self.u: D = None
        self.x: C = None
        self.y: C = None
        self.r: A = None
        self.q: A = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: C = None
        self.r: E = None
        self.v: E = None
        self.w: F = None
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.t: C = None
        self.q: A = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: H = None
        self.u: D = None
        self.x: C = None
        self.y: C = None
        self.r: A = None
        self.q: A = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: C = None
        self.r: E = None
        self.v: E = None
        self.w: F = None
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.t: C = None
        self.q: A = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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