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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: C = 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.q: F = None
        self.r: B = None
        self.p: A = None
        self.y: C = None
        self.t: B = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.o: A = None
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: A = None
        self.u: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: C = 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.q: F = None
        self.r: B = None
        self.p: A = None
        self.y: C = None
        self.t: B = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.o: A = None
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: A = None
        self.u: C = None
        self.txt = txt

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

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