class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: F = None
        self.q: E = None
        self.z: G = None
        self.p: G = None
        self.x: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: A = None
        self.r: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: G = None
        self.s: F = None
        self.p: F = None
        self.y: D = None
        self.r: A = None
        self.o: G = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: A = None
        self.r: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: G = None
        self.s: F = None
        self.p: F = None
        self.y: D = None
        self.r: A = None
        self.o: G = None
        self.txt = txt

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

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

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

d.v = g
d.y = b
d.q = a
d.z = h
d.p = h
d.x = n
g.u = i
g.y = m
g.x = b
m.o = i
m.y = d
m.r = b
i.r = l
i.v = g
i.u = m
n.u = d
n.r = d
n.w = h
n.o = h
n.s = b
n.p = b
n.y = i
b.s = l
b.p = h
b.t = h
b.v = g
b.y = i
b.q = m
h.x = a
h.t = b
h.q = i
a.u = d
a.r = d
a.w = h
a.o = h
a.s = b
a.p = b
a.y = i
l.v = g
l.y = b
l.q = a
l.x = a
l.z = h
l.p = h
assert g.x.q.o.r.txt == "l"