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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: A = None
        self.o: D = None
        self.p: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: C = None
        self.txt = txt

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

g.s = f
g.w = j
g.o = m
g.v = e
c.s = e
c.q = e
c.o = m
c.p = j
j.p = m
j.t = m
j.z = f
j.s = c
j.o = e
m.w = c
m.z = b
m.p = e
n.u = m
n.q = e
f.z = b
b.z = n
b.o = j
e.s = f
e.w = j
e.o = m
e.v = g
assert b.z.u.w.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: C = None
        self.o: D = None
        self.v: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: A = None
        self.o: D = None
        self.p: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: C = None
        self.txt = txt

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

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