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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: E = None
        self.z: F = None
        self.y: F = None
        self.t: F = None
        self.x: G = None
        self.p: A = None
        self.q: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: C = None
        self.y: C = None
        self.x: A = None
        self.o: F = None
        self.q: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: E = None
        self.z: F = None
        self.y: F = None
        self.t: F = None
        self.x: G = None
        self.p: A = None
        self.q: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: C = None
        self.y: C = None
        self.x: A = None
        self.o: F = None
        self.q: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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