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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: B = None
        self.t: A = None
        self.w: E = None
        self.u: E = None
        self.y: C = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: B = None
        self.t: A = None
        self.w: E = None
        self.u: E = None
        self.y: C = None
        self.txt = txt

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

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

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

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