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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: G = None
        self.r: G = None
        self.s: A = None
        self.txt = txt

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

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

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

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

j.p = e
a.w = d
a.u = b
b.w = e
b.t = e
b.o = m
b.p = k
b.s = d
b.v = a
b.z = a
d.u = l
d.x = n
d.r = m
d.s = j
k.q = d
k.s = d
k.o = m
l.t = e
l.o = m
l.v = m
l.s = a
l.y = b
n.z = m
n.w = j
n.o = b
n.s = e
m.z = n
m.w = j
m.o = b
m.s = l
e.t = l
e.o = m
e.v = n
e.s = a
e.y = b
assert j.p.v.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: G = None
        self.r: G = None
        self.s: A = None
        self.txt = txt

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

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

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

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

j.p = e
a.w = d
a.u = b
b.w = e
b.t = e
b.o = m
b.p = k
b.s = d
b.v = a
b.z = a
d.u = l
d.x = n
d.r = m
d.s = j
k.q = d
k.s = d
k.o = m
l.t = e
l.o = m
l.v = m
l.s = a
l.y = b
n.z = m
n.w = j
n.o = b
n.s = e
m.z = n
m.w = j
m.o = b
m.s = l
e.t = l
e.o = m
e.v = n
e.s = a
e.y = b
assert j.p.v.o.p.txt == "k"