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

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: F = None
        self.q: F = None
        self.t: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: F = None
        self.q: D = None
        self.txt = txt

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

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

m.s = e
m.o = k
m.p = k
m.y = b
m.v = a
g.y = d
g.o = f
g.t = b
e.s = b
e.z = a
e.q = a
e.t = m
h.t = b
h.s = a
h.o = d
h.v = g
b.s = g
a.r = g
a.y = k
a.q = h
j.w = m
k.r = g
k.y = a
k.q = d
f.w = m
d.t = b
d.s = a
d.o = h
d.v = g
assert k.y.q.o.v.o.w.v.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: F = None
        self.y: E = None
        self.p: F = None
        self.v: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: F = None
        self.q: F = None
        self.t: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: F = None
        self.q: D = None
        self.txt = txt

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

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

m.s = e
m.o = k
m.p = k
m.y = b
m.v = a
g.y = d
g.o = f
g.t = b
e.s = b
e.z = a
e.q = a
e.t = m
h.t = b
h.s = a
h.o = d
h.v = g
b.s = g
a.r = g
a.y = k
a.q = h
j.w = m
k.r = g
k.y = a
k.q = d
f.w = m
d.t = b
d.s = a
d.o = h
d.v = g
assert k.y.q.o.v.o.w.v.txt == "a"