class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: B = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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

j = A("j")
c = B("c")
b = C("b")
l = D("l")
g = E("g")
k = F("k")
f = F("f")
m = C("m")
a = A("a")

j.x = a
j.q = c
j.w = l
c.x = l
c.t = j
b.o = g
b.x = g
b.z = c
l.s = c
l.o = a
l.y = f
l.p = j
l.q = k
l.x = g
g.x = k
g.p = k
k.p = g
k.q = m
k.o = m
k.y = f
f.p = g
f.q = m
f.o = b
f.y = k
m.o = g
m.x = g
m.z = c
a.x = j
a.q = c
a.w = l
assert c.x.p.q.t.x.q.t.w.p.txt == "
class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: B = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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

j = A("j")
c = B("c")
b = C("b")
l = D("l")
g = E("g")
k = F("k")
f = F("f")
m = C("m")
a = A("a")

j.x = a
j.q = c
j.w = l
c.x = l
c.t = j
b.o = g
b.x = g
b.z = c
l.s = c
l.o = a
l.y = f
l.p = j
l.q = k
l.x = g
g.x = k
g.p = k
k.p = g
k.q = m
k.o = m
k.y = f
f.p = g
f.q = m
f.o = b
f.y = k
m.o = g
m.x = g
m.z = c
a.x = j
a.q = c
a.w = l
assert c.x.p.q.t.x.q.t.w.p.txt == "j"