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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: A = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: A = None
        self.q: A = None
        self.txt = txt

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

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