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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: D = None
        self.o: D = None
        self.s: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: E = None
        self.u: B = None
        self.s: A = None
        self.txt = txt

k = A("k")
l = B("l")
c = C("c")
f = D("f")
d = E("d")
e = F("e")
g = E("g")

k.s = c
k.x = e
k.p = l
l.z = d
l.p = d
l.w = f
c.x = k
c.s = k
c.t = d
c.v = e
f.t = e
d.p = k
d.q = f
d.o = f
d.s = g
e.z = f
e.t = g
e.u = l
e.s = k
g.p = k
g.q = f
g.o = f
g.s = d
assert c.t.p.s.v.s.x.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: F = None
        self.p: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: D = None
        self.o: D = None
        self.s: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: E = None
        self.u: B = None
        self.s: A = None
        self.txt = txt

k = A("k")
l = B("l")
c = C("c")
f = D("f")
d = E("d")
e = F("e")
g = E("g")

k.s = c
k.x = e
k.p = l
l.z = d
l.p = d
l.w = f
c.x = k
c.s = k
c.t = d
c.v = e
f.t = e
d.p = k
d.q = f
d.o = f
d.s = g
e.z = f
e.t = g
e.u = l
e.s = k
g.p = k
g.q = f
g.o = f
g.s = d
assert c.t.p.s.v.s.x.txt == "e"