class A:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: E = None
        self.s: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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

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