class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: D = None
        self.r: H = None
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: D = None
        self.r: A = None
        self.z: E = None
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: A = None
        self.x: C = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: D = None
        self.r: A = None
        self.z: E = None
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: A = None
        self.x: C = None
        self.txt = txt

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

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

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

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

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