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

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

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: G = None
        self.p: E = None
        self.o: E = None
        self.z: B = None
        self.s: B = None
        self.txt = txt

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

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

d.v = h
d.s = h
d.r = b
d.w = m
d.z = a
d.o = c
d.t = c
k.x = m
k.z = a
k.o = a
k.t = a
k.v = c
c.y = k
a.w = m
i.p = b
h.w = d
h.q = m
h.p = i
h.o = i
h.z = b
h.s = b
n.v = h
b.x = m
b.z = a
b.o = a
b.t = a
b.v = c
m.v = h
assert k.x.v.q.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: F = None
        self.r: B = None
        self.w: G = None
        self.z: D = None
        self.o: C = None
        self.t: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: G = None
        self.p: E = None
        self.o: E = None
        self.z: B = None
        self.s: B = None
        self.txt = txt

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

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

d.v = h
d.s = h
d.r = b
d.w = m
d.z = a
d.o = c
d.t = c
k.x = m
k.z = a
k.o = a
k.t = a
k.v = c
c.y = k
a.w = m
i.p = b
h.w = d
h.q = m
h.p = i
h.o = i
h.z = b
h.s = b
n.v = h
b.x = m
b.z = a
b.o = a
b.t = a
b.v = c
m.v = h
assert k.x.v.q.txt == "m"