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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: E = None
        self.o: F = None
        self.w: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: E = None
        self.o: F = None
        self.w: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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