class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: G = None
        self.v: B = None
        self.z: B = None
        self.u: B = None
        self.t: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: C = None
        self.t: A = None
        self.w: A = None
        self.o: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: C = None
        self.v: G = None
        self.q: G = None
        self.t: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: G = None
        self.v: C = None
        self.r: D = None
        self.w: A = None
        self.o: F = None
        self.z: E = None
        self.txt = txt

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

k.p = l
k.w = m
k.v = b
k.z = b
k.u = b
k.t = e
b.z = a
b.v = a
b.t = k
b.w = k
b.o = m
a.y = f
l.r = b
l.p = a
l.v = g
f.r = a
f.w = a
f.v = m
f.q = m
f.t = c
g.t = b
c.t = b
c.x = m
c.v = a
c.r = l
c.w = k
c.o = g
c.z = f
m.t = b
m.x = c
m.v = a
m.r = l
m.w = k
m.o = g
m.z = f
e.r = b
e.p = a
e.v = g
assert e.v.t.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: G = None
        self.v: B = None
        self.z: B = None
        self.u: B = None
        self.t: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: C = None
        self.t: A = None
        self.w: A = None
        self.o: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: C = None
        self.v: G = None
        self.q: G = None
        self.t: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: G = None
        self.v: C = None
        self.r: D = None
        self.w: A = None
        self.o: F = None
        self.z: E = None
        self.txt = txt

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

k.p = l
k.w = m
k.v = b
k.z = b
k.u = b
k.t = e
b.z = a
b.v = a
b.t = k
b.w = k
b.o = m
a.y = f
l.r = b
l.p = a
l.v = g
f.r = a
f.w = a
f.v = m
f.q = m
f.t = c
g.t = b
c.t = b
c.x = m
c.v = a
c.r = l
c.w = k
c.o = g
c.z = f
m.t = b
m.x = c
m.v = a
m.r = l
m.w = k
m.o = g
m.z = f
e.r = b
e.p = a
e.v = g
assert e.v.t.o.z.txt == "f"