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

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: G = None
        self.u: E = None
        self.r: F = None
        self.y: F = None
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: E = None
        self.z: F = None
        self.y: C = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: B = None
        self.u: G = None
        self.v: D = None
        self.q: B = None
        self.w: B = None
        self.txt = txt

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

l.v = n
l.w = h
i.z = a
i.x = f
i.q = n
i.v = l
i.y = b
i.o = d
d.o = k
d.z = m
d.u = b
d.w = b
d.r = f
d.y = f
h.o = m
b.w = f
b.z = f
b.o = n
b.y = d
b.x = h
f.o = d
f.u = h
m.y = l
m.p = a
m.w = a
m.u = k
m.v = h
m.q = i
a.z = i
a.x = f
a.q = b
a.v = l
a.y = n
a.o = d
k.y = l
k.p = a
k.u = m
k.v = h
k.q = i
k.w = i
n.w = f
n.z = f
n.o = b
n.y = d
n.x = h
assert f.u.o.v.o.w.q.y.r.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: G = None
        self.u: E = None
        self.r: F = None
        self.y: F = None
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: E = None
        self.z: F = None
        self.y: C = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: B = None
        self.u: G = None
        self.v: D = None
        self.q: B = None
        self.w: B = None
        self.txt = txt

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

l.v = n
l.w = h
i.z = a
i.x = f
i.q = n
i.v = l
i.y = b
i.o = d
d.o = k
d.z = m
d.u = b
d.w = b
d.r = f
d.y = f
h.o = m
b.w = f
b.z = f
b.o = n
b.y = d
b.x = h
f.o = d
f.u = h
m.y = l
m.p = a
m.w = a
m.u = k
m.v = h
m.q = i
a.z = i
a.x = f
a.q = b
a.v = l
a.y = n
a.o = d
k.y = l
k.p = a
k.u = m
k.v = h
k.q = i
k.w = i
n.w = f
n.z = f
n.o = b
n.y = d
n.x = h
assert f.u.o.v.o.w.q.y.r.o.o.txt == "k"