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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: A = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: A = None
        self.v: C = None
        self.x: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: F = None
        self.u: E = None
        self.x: E = None
        self.t: G = None
        self.z: F = None
        self.p: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: A = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: A = None
        self.v: C = None
        self.x: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: F = None
        self.u: E = None
        self.x: E = None
        self.t: G = None
        self.z: F = None
        self.p: C = None
        self.txt = txt

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

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

n.w = j
b.q = m
f.u = k
f.y = n
f.x = n
k.y = m
k.q = n
k.v = f
k.x = l
m.x = c
m.t = j
m.w = b
m.y = k
l.q = k
l.v = j
l.z = j
l.u = m
l.x = m
l.t = c
l.p = f
c.s = b
c.u = b
c.v = k
j.q = k
j.v = l
j.z = l
j.u = m
j.x = m
j.t = c
j.p = g
g.u = k
g.y = n
g.x = n
assert k.q.w.x.x.s.q.x.s.q.txt == "m"