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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: H = None
        self.s: F = None
        self.z: C = None
        self.x: F = None
        self.u: E = None
        self.txt = txt

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

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

a.y = b
a.u = n
a.w = d
b.v = f
j.o = b
j.x = l
d.q = l
d.z = l
d.s = l
d.t = b
f.p = d
f.y = d
n.v = j
l.p = f
l.u = f
l.v = i
l.s = n
l.x = n
l.z = j
i.t = n
assert d.t.v.p.s.p.p.q.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: F = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: H = None
        self.s: F = None
        self.z: C = None
        self.x: F = None
        self.u: E = None
        self.txt = txt

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

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

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