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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: E = None
        self.s: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

g = A("g")
i = B("i")
m = C("m")
n = D("n")
b = E("b")
d = F("d")
j = E("j")

g.u = j
g.s = d
g.v = b
g.q = b
g.p = n
g.x = n
i.p = g
m.o = n
m.y = j
m.s = b
n.q = j
n.v = g
n.o = b
n.t = d
b.y = g
b.z = g
b.u = m
b.p = n
d.z = i
j.y = g
j.z = g
j.u = m
j.p = n
assert i.p.v.p.v.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: F = None
        self.v: E = None
        self.p: D = None
        self.q: E = None
        self.x: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: E = None
        self.s: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

g = A("g")
i = B("i")
m = C("m")
n = D("n")
b = E("b")
d = F("d")
j = E("j")

g.u = j
g.s = d
g.v = b
g.q = b
g.p = n
g.x = n
i.p = g
m.o = n
m.y = j
m.s = b
n.q = j
n.v = g
n.o = b
n.t = d
b.y = g
b.z = g
b.u = m
b.p = n
d.z = i
j.y = g
j.z = g
j.u = m
j.p = n
assert i.p.v.p.v.u.p.txt == "n"