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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: E = None
        self.o: G = None
        self.v: G = None
        self.t: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: E = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: D = None
        self.y: F = None
        self.txt = txt

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

g.w = a
g.p = a
g.q = m
g.z = m
g.x = b
g.v = f
f.y = m
m.u = f
m.w = l
m.o = h
m.v = b
m.t = n
a.t = f
a.q = i
a.p = n
e.x = b
e.q = m
e.u = l
n.t = f
n.s = e
n.x = m
b.p = m
b.s = i
b.y = n
h.p = m
h.s = a
h.y = n
i.t = f
i.q = a
i.p = n
l.x = b
l.q = m
l.u = e
assert f.y.v.p.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: C = None
        self.p: D = None
        self.z: C = None
        self.x: G = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: E = None
        self.o: G = None
        self.v: G = None
        self.t: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: E = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: D = None
        self.y: F = None
        self.txt = txt

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

g.w = a
g.p = a
g.q = m
g.z = m
g.x = b
g.v = f
f.y = m
m.u = f
m.w = l
m.o = h
m.v = b
m.t = n
a.t = f
a.q = i
a.p = n
e.x = b
e.q = m
e.u = l
n.t = f
n.s = e
n.x = m
b.p = m
b.s = i
b.y = n
h.p = m
h.s = a
h.y = n
i.t = f
i.q = a
i.p = n
l.x = b
l.q = m
l.u = e
assert f.y.v.p.txt == "m"