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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: D = None
        self.t: B = None
        self.r: 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.p: B = None
        self.y: G = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: E = None
        self.o: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: D = None
        self.t: B = None
        self.r: 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.p: B = None
        self.y: G = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: E = None
        self.o: C = None
        self.txt = txt

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

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

l.o = d
l.p = i
l.x = g
l.s = g
l.t = e
l.v = h
i.u = f
i.r = h
e.q = l
e.y = d
e.t = i
e.r = h
d.o = f
h.p = i
h.y = f
h.z = e
g.v = l
g.p = h
g.o = e
f.s = l
assert l.s.p.p.r.z.txt == "e"