class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: E = None
        self.o: A = None
        self.t: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: F = None
        self.s: B = None
        self.u: A = None
        self.q: G = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: G = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: F = None
        self.s: B = None
        self.u: A = None
        self.q: G = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: G = None
        self.txt = txt

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

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

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

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