class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: B = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.s: E = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: B = None
        self.z: F = None
        self.p: B = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: B = None
        self.v: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: E = None
        self.p: A = None
        self.r: D = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: F = None
        self.y: E = None
        self.txt = txt

n = A("n")
k = B("k")
h = C("h")
f = D("f")
c = E("c")
e = F("e")
j = G("j")
a = E("a")
i = F("i")

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.s: E = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: B = None
        self.z: F = None
        self.p: B = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: B = None
        self.v: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: E = None
        self.p: A = None
        self.r: D = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: F = None
        self.y: E = None
        self.txt = txt

n = A("n")
k = B("k")
h = C("h")
f = D("f")
c = E("c")
e = F("e")
j = G("j")
a = E("a")
i = F("i")

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