class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: G = None
        self.o: C = None
        self.y: G = None
        self.x: F = None
        self.r: G = None
        self.v: F = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: G = None
        self.t: C = None
        self.q: E = None
        self.v: G = None
        self.p: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: A = None
        self.w: C = None
        self.u: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: G = None
        self.t: C = None
        self.q: E = None
        self.v: G = None
        self.p: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: A = None
        self.w: C = None
        self.u: A = None
        self.txt = txt

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

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