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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: G = None
        self.s: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: G = None
        self.x: A = None
        self.y: B = None
        self.o: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: C = None
        self.r: G = None
        self.u: E = None
        self.y: G = None
        self.t: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: G = None
        self.s: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: G = None
        self.x: A = None
        self.y: B = None
        self.o: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: C = None
        self.r: G = None
        self.u: E = None
        self.y: G = None
        self.t: D = None
        self.txt = txt

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

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