class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: F = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: C = None
        self.z: D = None
        self.txt = txt

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

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

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

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

n = A("n")
h = B("h")
j = C("j")
c = D("c")
b = E("b")
i = F("i")

n.u = i
n.s = i
n.t = b
h.y = j
h.v = j
h.z = c
j.y = b
j.v = h
j.t = c
c.o = n
b.o = n
b.q = h
i.r = j
i.v = c
i.o = n
i.t = h
i.z = h
assert h.z.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: F = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: C = None
        self.z: D = None
        self.txt = txt

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

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

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

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

n = A("n")
h = B("h")
j = C("j")
c = D("c")
b = E("b")
i = F("i")

n.u = i
n.s = i
n.t = b
h.y = j
h.v = j
h.z = c
j.y = b
j.v = h
j.t = c
c.o = n
b.o = n
b.q = h
i.r = j
i.v = c
i.o = n
i.t = h
i.z = h
assert h.z.o.u.txt == "i"