class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: B = None
        self.r: G = None
        self.u: F = None
        self.t: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: E = None
        self.u: G = None
        self.t: A = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: E = None
        self.u: G = None
        self.t: A = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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

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

j.p = n
j.r = n
j.v = a
j.u = c
j.t = c
a.r = j
a.t = j
a.q = l
a.u = n
a.s = m
m.y = k
m.t = j
m.u = f
f.x = j
f.v = j
l.o = m
c.p = j
c.q = n
n.o = m
d.p = j
d.q = n
k.o = m
assert c.p.r.o.y.o.t.v.txt == "a"