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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: G = None
        self.q: D = None
        self.v: G = None
        self.txt = txt

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

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

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

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

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

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

i.r = b
i.v = b
i.y = b
i.x = n
i.z = n
j.z = f
j.p = k
j.v = k
j.q = a
d.x = k
d.t = f
b.r = a
b.t = a
b.p = i
b.x = f
n.t = i
n.p = j
f.x = n
f.o = k
f.q = k
k.v = m
m.x = k
m.t = f
a.r = b
a.t = b
a.p = i
a.x = f
assert m.x.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: E = None
        self.v: D = None
        self.y: D = None
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: G = None
        self.q: D = None
        self.v: G = None
        self.txt = txt

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

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

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

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

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

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

i.r = b
i.v = b
i.y = b
i.x = n
i.z = n
j.z = f
j.p = k
j.v = k
j.q = a
d.x = k
d.t = f
b.r = a
b.t = a
b.p = i
b.x = f
n.t = i
n.p = j
f.x = n
f.o = k
f.q = k
k.v = m
m.x = k
m.t = f
a.r = b
a.t = b
a.p = i
a.x = f
assert m.x.v.t.txt == "f"