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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: C = None
        self.x: B = None
        self.t: D = None
        self.v: B = None
        self.r: E = None
        self.txt = txt

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

i.u = k
i.y = m
n.z = g
n.o = m
n.p = m
k.o = m
k.q = g
k.y = i
j.x = k
j.z = m
j.q = g
j.y = n
m.v = g
g.u = i
g.q = k
g.x = n
g.v = n
g.t = j
g.r = m
assert i.y.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: C = None
        self.x: B = None
        self.t: D = None
        self.v: B = None
        self.r: E = None
        self.txt = txt

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

i.u = k
i.y = m
n.z = g
n.o = m
n.p = m
k.o = m
k.q = g
k.y = i
j.x = k
j.z = m
j.q = g
j.y = n
m.v = g
g.u = i
g.q = k
g.x = n
g.v = n
g.t = j
g.r = m
assert i.y.v.u.txt == "i"