class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: D = None
        self.o: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: F = None
        self.q: F = None
        self.y: D = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: A = None
        self.p: F = None
        self.o: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: A = None
        self.x: G = None
        self.q: C = None
        self.o: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: F = None
        self.q: F = None
        self.y: D = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: A = None
        self.p: F = None
        self.o: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: A = None
        self.x: G = None
        self.q: C = None
        self.o: B = None
        self.txt = txt

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

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

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