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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: E = None
        self.z: B = None
        self.r: A = None
        self.y: G = None
        self.s: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: A = None
        self.w: A = None
        self.t: G = None
        self.q: A = None
        self.txt = txt

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

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

g.w = e
k.q = e
k.o = c
k.u = j
k.v = g
k.y = f
k.r = f
c.q = k
c.z = k
c.s = k
c.v = f
c.r = g
c.y = m
j.t = m
f.x = e
a.x = j
a.v = g
a.w = g
a.q = g
a.t = m
e.s = k
e.r = k
e.q = f
e.t = f
e.z = c
e.p = a
e.x = g
m.s = k
m.r = k
m.q = f
m.t = f
m.z = c
m.p = a
m.x = g
assert m.z.r.w.s.v.w.z.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: E = None
        self.z: B = None
        self.r: A = None
        self.y: G = None
        self.s: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: A = None
        self.w: A = None
        self.t: G = None
        self.q: A = None
        self.txt = txt

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

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

g.w = e
k.q = e
k.o = c
k.u = j
k.v = g
k.y = f
k.r = f
c.q = k
c.z = k
c.s = k
c.v = f
c.r = g
c.y = m
j.t = m
f.x = e
a.x = j
a.v = g
a.w = g
a.q = g
a.t = m
e.s = k
e.r = k
e.q = f
e.t = f
e.z = c
e.p = a
e.x = g
m.s = k
m.r = k
m.q = f
m.t = f
m.z = c
m.p = a
m.x = g
assert m.z.r.w.s.v.w.z.v.txt == "f"