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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: B = None
        self.t: F = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: C = None
        self.x: E = None
        self.u: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: D = None
        self.v: C = None
        self.y: D = None
        self.p: B = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: C = None
        self.q: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: B = None
        self.t: F = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: C = None
        self.x: E = None
        self.u: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: D = None
        self.v: C = None
        self.y: D = None
        self.p: B = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: C = None
        self.q: B = None
        self.txt = txt

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

n.q = k
n.v = k
g.q = i
g.t = i
g.w = b
g.p = c
k.o = b
k.t = c
k.x = a
k.u = n
m.x = k
e.u = m
e.t = m
e.y = m
e.v = k
e.p = b
e.o = g
i.s = c
i.r = c
i.q = b
a.u = m
a.t = m
a.y = m
a.v = k
a.p = g
a.o = b
b.q = i
b.t = i
b.w = g
b.p = k
c.o = g
c.t = k
c.x = a
c.u = n
assert e.o.w.w.q.q.txt == "b"