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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: B = None
        self.p: C = None
        self.x: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: E = None
        self.s: G = None
        self.u: A = None
        self.y: G = None
        self.q: E = None
        self.txt = txt

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

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

n.q = c
n.t = d
n.o = h
e.z = j
e.t = b
e.p = d
e.x = d
d.o = j
d.u = n
j.r = n
j.x = n
j.u = c
j.y = e
j.q = b
j.v = h
c.u = j
c.t = a
c.r = n
c.s = n
c.q = d
a.v = j
a.p = c
a.q = c
a.s = h
a.y = h
a.u = n
h.v = d
h.u = b
b.z = j
b.t = e
b.p = d
b.x = d
assert n.o.u.z.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: C = None
        self.o: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: B = None
        self.p: C = None
        self.x: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: E = None
        self.s: G = None
        self.u: A = None
        self.y: G = None
        self.q: E = None
        self.txt = txt

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

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

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