class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: F = None
        self.w: D = None
        self.r: D = None
        self.v: B = None
        self.u: B = None
        self.txt = txt

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

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

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

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

m = A("m")
b = B("b")
f = C("f")
k = D("k")
a = E("a")
d = F("d")
c = G("c")
l = B("l")
h = B("h")

m.v = c
m.q = l
b.t = a
b.u = a
b.v = c
b.z = k
f.x = k
f.w = k
f.r = k
f.p = d
f.v = l
f.u = h
k.q = d
k.w = b
a.u = f
a.s = f
a.p = k
d.s = a
d.p = f
d.q = f
d.y = l
d.w = m
c.v = m
l.t = a
l.u = a
l.v = c
l.z = k
h.t = a
h.u = a
h.v = c
h.z = k
assert c.v.q.v.v.v.v.q.u.s.txt == "
class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: F = None
        self.w: D = None
        self.r: D = None
        self.v: B = None
        self.u: B = None
        self.txt = txt

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

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

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

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

m = A("m")
b = B("b")
f = C("f")
k = D("k")
a = E("a")
d = F("d")
c = G("c")
l = B("l")
h = B("h")

m.v = c
m.q = l
b.t = a
b.u = a
b.v = c
b.z = k
f.x = k
f.w = k
f.r = k
f.p = d
f.v = l
f.u = h
k.q = d
k.w = b
a.u = f
a.s = f
a.p = k
d.s = a
d.p = f
d.q = f
d.y = l
d.w = m
c.v = m
l.t = a
l.u = a
l.v = c
l.z = k
h.t = a
h.u = a
h.v = c
h.z = k
assert c.v.q.v.v.v.v.q.u.s.txt == "f"