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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: A = None
        self.w: E = None
        self.y: E = None
        self.txt = txt

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

i.o = g
i.x = a
i.q = b
i.s = b
j.t = i
j.z = i
j.o = b
a.x = b
k.u = g
g.y = a
b.r = a
b.z = i
b.w = g
b.y = g
assert k.u.y.x.w.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: C = None
        self.q: F = None
        self.s: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: A = None
        self.w: E = None
        self.y: E = None
        self.txt = txt

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

i.o = g
i.x = a
i.q = b
i.s = b
j.t = i
j.z = i
j.o = b
a.x = b
k.u = g
g.y = a
b.r = a
b.z = i
b.w = g
b.y = g
assert k.u.y.x.w.y.x.txt == "b"