class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: D = None
        self.w: F = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: C = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: D = None
        self.w: F = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: C = None
        self.p: B = None
        self.txt = txt

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

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

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

b.w = i
n.s = j
n.x = c
n.o = e
h.u = i
h.w = i
h.t = j
h.o = e
j.y = i
j.u = h
j.p = n
c.p = b
c.q = b
c.t = i
c.x = n
c.z = j
i.o = c
e.w = i
assert i.o.z.y.txt == "i"