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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: B = None
        self.v: F = None
        self.u: B = None
        self.y: A = None
        self.r: F = None
        self.x: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.v: E = None
        self.w: A = None
        self.txt = txt

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

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

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

e = A("e")
i = B("i")
m = C("m")
b = D("b")
c = E("c")
k = F("k")
l = G("l")
j = B("j")

e.p = i
i.o = c
i.q = j
i.u = j
i.v = k
i.r = k
i.y = e
i.x = e
m.z = b
m.o = l
m.u = l
m.r = l
b.z = k
b.v = c
b.w = e
c.u = b
c.r = b
c.y = l
k.p = i
l.p = m
j.o = c
j.q = i
j.u = i
j.v = k
j.r = k
j.y = e
j.x = e
assert k.p.q.x.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: B = None
        self.v: F = None
        self.u: B = None
        self.y: A = None
        self.r: F = None
        self.x: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.v: E = None
        self.w: A = None
        self.txt = txt

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

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

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

e = A("e")
i = B("i")
m = C("m")
b = D("b")
c = E("c")
k = F("k")
l = G("l")
j = B("j")

e.p = i
i.o = c
i.q = j
i.u = j
i.v = k
i.r = k
i.y = e
i.x = e
m.z = b
m.o = l
m.u = l
m.r = l
b.z = k
b.v = c
b.w = e
c.u = b
c.r = b
c.y = l
k.p = i
l.p = m
j.o = c
j.q = i
j.u = i
j.v = k
j.r = k
j.y = e
j.x = e
assert k.p.q.x.p.o.txt == "c"