class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: F = None
        self.r: C = None
        self.o: A = None
        self.s: A = None
        self.z: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: E = None
        self.x: E = None
        self.z: F = None
        self.txt = txt

g = A("g")
d = B("d")
n = C("n")
i = D("i")
f = E("f")
l = F("l")
c = G("c")
a = A("a")

g.y = c
g.x = l
g.z = l
g.r = n
g.o = a
g.s = a
d.u = l
d.t = f
d.y = f
d.o = f
d.z = c
n.x = f
n.y = f
n.w = l
n.v = i
i.y = f
f.r = a
f.u = d
f.q = d
f.y = c
l.o = f
l.w = i
l.y = d
c.s = i
c.q = f
c.x = f
c.z = l
a.y = c
a.x = l
a.z = l
a.r = n
a.o = g
a.s = g
assert d.u.o.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: F = None
        self.r: C = None
        self.o: A = None
        self.s: A = None
        self.z: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: E = None
        self.x: E = None
        self.z: F = None
        self.txt = txt

g = A("g")
d = B("d")
n = C("n")
i = D("i")
f = E("f")
l = F("l")
c = G("c")
a = A("a")

g.y = c
g.x = l
g.z = l
g.r = n
g.o = a
g.s = a
d.u = l
d.t = f
d.y = f
d.o = f
d.z = c
n.x = f
n.y = f
n.w = l
n.v = i
i.y = f
f.r = a
f.u = d
f.q = d
f.y = c
l.o = f
l.w = i
l.y = d
c.s = i
c.q = f
c.x = f
c.z = l
a.y = c
a.x = l
a.z = l
a.r = n
a.o = g
a.s = g
assert d.u.o.y.z.txt == "l"