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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: A = None
        self.w: E = None
        self.r: E = None
        self.txt = txt

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

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

l.z = g
l.q = g
l.r = g
l.u = m
l.x = i
g.x = i
g.z = l
i.p = c
i.x = g
i.r = l
e.s = m
e.p = a
e.w = a
a.u = k
a.z = k
a.w = b
a.r = b
c.p = e
c.s = k
c.y = k
c.w = k
c.o = b
h.u = k
h.z = k
h.w = a
h.r = b
m.p = e
m.s = k
m.y = l
m.w = l
m.o = h
b.u = k
b.z = l
b.w = h
b.r = a
k.z = g
k.q = g
k.r = g
k.u = c
k.x = i
assert g.x.x.x.r.u.w.x.r.q.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: B = None
        self.u: F = None
        self.r: B = None
        self.x: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: A = None
        self.w: E = None
        self.r: E = None
        self.txt = txt

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

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

l.z = g
l.q = g
l.r = g
l.u = m
l.x = i
g.x = i
g.z = l
i.p = c
i.x = g
i.r = l
e.s = m
e.p = a
e.w = a
a.u = k
a.z = k
a.w = b
a.r = b
c.p = e
c.s = k
c.y = k
c.w = k
c.o = b
h.u = k
h.z = k
h.w = a
h.r = b
m.p = e
m.s = k
m.y = l
m.w = l
m.o = h
b.u = k
b.z = l
b.w = h
b.r = a
k.z = g
k.q = g
k.r = g
k.u = c
k.x = i
assert g.x.x.x.r.u.w.x.r.q.txt == "g"