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

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: C = None
        self.t: C = None
        self.z: F = None
        self.o: F = None
        self.r: A = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: D = None
        self.q: G = None
        self.txt = txt

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

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

l.v = j
l.x = j
l.u = g
l.o = n
l.w = n
l.z = m
h.w = n
h.p = n
h.o = d
h.u = d
h.q = d
m.z = n
m.p = g
m.o = h
d.x = m
d.w = m
d.t = m
d.u = m
d.z = g
d.o = g
d.r = l
n.u = d
n.q = g
g.w = j
g.q = j
g.t = d
j.x = l
j.r = g
assert m.o.p.q.txt == "
class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.u: F = None
        self.o: E = None
        self.z: C = None
        self.x: G = None
        self.w: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: C = None
        self.t: C = None
        self.z: F = None
        self.o: F = None
        self.r: A = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: D = None
        self.q: G = None
        self.txt = txt

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

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

l.v = j
l.x = j
l.u = g
l.o = n
l.w = n
l.z = m
h.w = n
h.p = n
h.o = d
h.u = d
h.q = d
m.z = n
m.p = g
m.o = h
d.x = m
d.w = m
d.t = m
d.u = m
d.z = g
d.o = g
d.r = l
n.u = d
n.q = g
g.w = j
g.q = j
g.t = d
j.x = l
j.r = g
assert m.o.p.q.txt == "g"