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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: B = None
        self.p: C = None
        self.r: D = None
        self.q: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: F = None
        self.o: D = None
        self.t: A = None
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: E = None
        self.q: E = None
        self.p: F = None
        self.o: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: B = None
        self.p: C = None
        self.r: D = None
        self.q: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: F = None
        self.o: D = None
        self.t: A = None
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: E = None
        self.q: E = None
        self.p: F = None
        self.o: B = None
        self.txt = txt

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

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