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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: A = None
        self.t: B = None
        self.p: G = None
        self.r: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: A = None
        self.p: C = None
        self.o: F = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: D = None
        self.u: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: A = None
        self.t: B = None
        self.p: G = None
        self.r: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: A = None
        self.p: C = None
        self.o: F = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: D = None
        self.u: A = None
        self.txt = txt

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

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

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

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