class A:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: D = None
        self.p: D = None
        self.q: E = None
        self.t: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

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

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