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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: B = None
        self.y: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: G = None
        self.y: B = None
        self.x: D = None
        self.o: A = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: C = None
        self.z: C = None
        self.q: C = None
        self.o: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: B = None
        self.y: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: G = None
        self.y: B = None
        self.x: D = None
        self.o: A = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: C = None
        self.z: C = None
        self.q: C = None
        self.o: C = None
        self.txt = txt

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

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

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