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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: E = None
        self.x: G = None
        self.t: G = None
        self.w: F = None
        self.txt = txt

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

f = A("f")
e = B("e")
n = C("n")
m = D("m")
d = E("d")
b = F("b")
c = G("c")
i = G("i")
j = F("j")

f.o = m
f.q = e
f.r = d
e.w = f
n.s = d
n.v = b
n.o = e
m.v = b
m.w = c
m.q = j
m.s = e
d.w = f
d.z = f
d.t = e
d.s = m
d.p = n
b.v = j
b.w = j
b.p = d
b.x = i
b.t = i
c.u = d
c.s = i
c.v = m
i.u = d
i.s = c
i.v = m
j.v = b
j.w = b
j.p = d
j.x = c
j.t = c
assert m.w.v.q.p.p.s.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: B = None
        self.r: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: E = None
        self.x: G = None
        self.t: G = None
        self.w: F = None
        self.txt = txt

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

f = A("f")
e = B("e")
n = C("n")
m = D("m")
d = E("d")
b = F("b")
c = G("c")
i = G("i")
j = F("j")

f.o = m
f.q = e
f.r = d
e.w = f
n.s = d
n.v = b
n.o = e
m.v = b
m.w = c
m.q = j
m.s = e
d.w = f
d.z = f
d.t = e
d.s = m
d.p = n
b.v = j
b.w = j
b.p = d
b.x = i
b.t = i
c.u = d
c.s = i
c.v = m
i.u = d
i.s = c
i.v = m
j.v = b
j.w = b
j.p = d
j.x = c
j.t = c
assert m.w.v.q.p.p.s.p.v.txt == "b"