class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: B = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

h.r = d
h.q = d
h.o = l
d.r = h
d.p = h
d.v = m
d.q = l
d.t = f
d.u = k
c.o = f
c.s = n
f.t = n
l.w = g
l.u = h
l.y = h
n.p = d
n.w = h
n.v = h
n.y = k
n.s = f
g.s = f
m.o = f
m.s = n
k.r = h
k.p = h
k.v = m
k.q = l
k.t = f
k.u = d
assert m.o.t.p.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: B = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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