class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: E = None
        self.r: D = None
        self.t: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: B = None
        self.z: D = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: B = None
        self.z: D = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

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