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

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

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: A = None
        self.q: C = None
        self.y: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

f = A("f")
l = B("l")
j = C("j")
g = D("g")
c = E("c")
i = F("i")

f.y = l
l.x = c
l.t = f
j.v = g
j.w = c
j.x = l
g.r = i
g.v = f
g.q = j
g.y = j
c.s = l
c.o = f
c.w = f
i.t = g
assert i.t.v.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: A = None
        self.q: C = None
        self.y: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

f = A("f")
l = B("l")
j = C("j")
g = D("g")
c = E("c")
i = F("i")

f.y = l
l.x = c
l.t = f
j.v = g
j.w = c
j.x = l
g.r = i
g.v = f
g.q = j
g.y = j
c.s = l
c.o = f
c.w = f
i.t = g
assert i.t.v.y.x.txt == "c"