class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: E = None
        self.t: E = None
        self.y: C = None
        self.u: A = None
        self.x: C = None
        self.w: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: A = None
        self.w: E = None
        self.u: F = None
        self.y: E = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: D = None
        self.q: F = None
        self.w: F = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: B = None
        self.s: G = None
        self.y: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: B = None
        self.t: D = None
        self.txt = txt

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

l.p = m
l.v = i
l.t = i
l.y = b
l.x = b
l.u = n
l.w = n
h.t = m
h.q = l
h.w = i
h.y = i
h.p = i
h.u = d
b.u = n
b.t = m
b.q = d
b.w = d
b.p = i
m.q = k
m.s = k
m.u = h
m.y = i
i.s = b
i.p = h
i.x = m
i.w = m
d.o = m
k.v = n
k.y = h
k.t = m
n.p = m
n.v = i
n.t = i
n.y = b
n.x = b
n.u = l
n.w = l
assert k.v.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: E = None
        self.t: E = None
        self.y: C = None
        self.u: A = None
        self.x: C = None
        self.w: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: A = None
        self.w: E = None
        self.u: F = None
        self.y: E = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: D = None
        self.q: F = None
        self.w: F = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: B = None
        self.s: G = None
        self.y: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: B = None
        self.t: D = None
        self.txt = txt

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

l.p = m
l.v = i
l.t = i
l.y = b
l.x = b
l.u = n
l.w = n
h.t = m
h.q = l
h.w = i
h.y = i
h.p = i
h.u = d
b.u = n
b.t = m
b.q = d
b.w = d
b.p = i
m.q = k
m.s = k
m.u = h
m.y = i
i.s = b
i.p = h
i.x = m
i.w = m
d.o = m
k.v = n
k.y = h
k.t = m
n.p = m
n.v = i
n.t = i
n.y = b
n.x = b
n.u = l
n.w = l
assert k.v.y.t.txt == "m"