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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: A = None
        self.w: C = None
        self.o: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: B = None
        self.txt = txt

a = A("a")
l = B("l")
d = C("d")
i = D("i")
h = E("h")
c = F("c")
n = G("n")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: A = None
        self.w: C = None
        self.o: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: B = None
        self.txt = txt

a = A("a")
l = B("l")
d = C("d")
i = D("i")
h = E("h")
c = F("c")
n = G("n")

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