class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: F = None
        self.x: C = None
        self.z: D = None
        self.y: G = None
        self.s: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: E = None
        self.u: C = None
        self.p: C = None
        self.txt = txt

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

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

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

d = A("d")
f = B("f")
g = C("g")
l = D("l")
m = E("m")
b = F("b")
n = G("n")

d.v = b
d.p = b
d.x = g
d.z = l
d.y = n
d.s = n
f.x = l
f.y = l
g.x = n
g.t = d
g.v = f
g.o = b
l.s = m
l.o = m
l.u = g
l.p = g
m.t = l
m.o = n
b.x = m
n.t = d
n.p = m
n.z = m
n.s = g
assert b.x.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: F = None
        self.x: C = None
        self.z: D = None
        self.y: G = None
        self.s: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: E = None
        self.u: C = None
        self.p: C = None
        self.txt = txt

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

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

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

d = A("d")
f = B("f")
g = C("g")
l = D("l")
m = E("m")
b = F("b")
n = G("n")

d.v = b
d.p = b
d.x = g
d.z = l
d.y = n
d.s = n
f.x = l
f.y = l
g.x = n
g.t = d
g.v = f
g.o = b
l.s = m
l.o = m
l.u = g
l.p = g
m.t = l
m.o = n
b.x = m
n.t = d
n.p = m
n.z = m
n.s = g
assert b.x.o.z.txt == "m"