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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: D = None
        self.u: D = None
        self.z: E = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: D = None
        self.z: D = None
        self.o: E = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: D = None
        self.u: D = None
        self.z: E = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: D = None
        self.z: D = None
        self.o: E = None
        self.v: A = None
        self.txt = txt

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

a.y = b
c.o = b
c.v = k
c.y = n
c.x = j
j.o = a
e.z = n
e.o = d
e.p = g
e.w = k
n.o = g
n.z = g
n.p = e
n.u = e
n.v = a
i.t = c
i.q = b
i.z = b
i.o = n
i.v = d
d.y = e
g.o = n
g.z = n
g.p = b
g.u = b
g.v = a
k.t = c
k.q = b
k.z = b
k.o = g
k.v = d
b.z = n
b.o = d
b.p = g
b.w = i
assert j.o.y.w.o.o.p.p.txt == "g"