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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: A = None
        self.r: C = None
        self.q: B = None
        self.v: C = None
        self.txt = txt

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

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

g.v = h
g.x = k
g.q = k
d.w = e
d.v = l
d.u = l
a.p = e
a.w = i
a.o = d
a.v = d
l.t = n
l.q = g
m.o = e
m.w = g
m.r = h
m.q = d
m.v = i
n.o = h
k.o = h
i.p = m
i.w = a
i.o = d
i.v = d
e.o = m
e.w = g
e.r = i
e.q = d
e.v = a
h.p = m
h.w = a
h.o = d
h.v = d
assert k.o.o.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: F = None
        self.q: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: A = None
        self.r: C = None
        self.q: B = None
        self.v: C = None
        self.txt = txt

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

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

g.v = h
g.x = k
g.q = k
d.w = e
d.v = l
d.u = l
a.p = e
a.w = i
a.o = d
a.v = d
l.t = n
l.q = g
m.o = e
m.w = g
m.r = h
m.q = d
m.v = i
n.o = h
k.o = h
i.p = m
i.w = a
i.o = d
i.v = d
e.o = m
e.w = g
e.r = i
e.q = d
e.v = a
h.p = m
h.w = a
h.o = d
h.v = d
assert k.o.o.u.q.txt == "g"