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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: F = None
        self.t: H = None
        self.x: B = None
        self.z: B = None
        self.r: H = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: B = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: C = None
        self.s: A = None
        self.q: H = None
        self.u: C = None
        self.o: A = None
        self.t: F = None
        self.txt = txt

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

c = A("c")
b = B("b")
n = C("n")
k = D("k")
j = E("j")
l = F("l")
g = G("g")
h = H("h")
f = H("f")

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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: F = None
        self.t: H = None
        self.x: B = None
        self.z: B = None
        self.r: H = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: B = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: C = None
        self.s: A = None
        self.q: H = None
        self.u: C = None
        self.o: A = None
        self.t: F = None
        self.txt = txt

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

c = A("c")
b = B("b")
n = C("n")
k = D("k")
j = E("j")
l = F("l")
g = G("g")
h = H("h")
f = H("f")

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