class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: D = None
        self.u: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: G = None
        self.s: A = None
        self.r: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: B = None
        self.v: F = None
        self.u: A = None
        self.y: B = None
        self.z: A = None
        self.txt = txt

b = A("b")
i = B("i")
k = C("k")
l = D("l")
e = E("e")
a = F("a")
c = G("c")

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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: G = None
        self.s: A = None
        self.r: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: B = None
        self.v: F = None
        self.u: A = None
        self.y: B = None
        self.z: A = None
        self.txt = txt

b = A("b")
i = B("i")
k = C("k")
l = D("l")
e = E("e")
a = F("a")
c = G("c")

b.t = a
b.x = l
b.u = l
i.x = k
k.t = e
k.p = c
k.s = b
k.r = a
l.r = k
l.q = k
l.x = b
l.u = b
l.y = c
l.z = c
l.o = i
e.x = i
e.p = l
a.z = b
a.o = i
a.v = l
c.s = b
c.u = b
c.z = b
c.t = i
c.y = i
c.v = a
assert a.v.u.t.o.x.p.v.txt == "a"