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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: A = None
        self.y: B = None
        self.q: A = None
        self.txt = txt

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

l = A("l")
f = B("f")
k = C("k")
j = D("j")
h = E("h")
c = F("c")

l.s = k
l.y = h
f.t = c
f.x = c
f.o = l
f.s = l
f.q = h
k.u = j
k.r = j
k.y = h
k.p = c
k.t = f
j.s = f
h.r = j
h.w = l
h.q = l
h.y = f
c.u = k
c.r = f
c.s = h
c.x = l
c.o = l
assert l.s.t.s.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: A = None
        self.y: B = None
        self.q: A = None
        self.txt = txt

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

l = A("l")
f = B("f")
k = C("k")
j = D("j")
h = E("h")
c = F("c")

l.s = k
l.y = h
f.t = c
f.x = c
f.o = l
f.s = l
f.q = h
k.u = j
k.r = j
k.y = h
k.p = c
k.t = f
j.s = f
h.r = j
h.w = l
h.q = l
h.y = f
c.u = k
c.r = f
c.s = h
c.x = l
c.o = l
assert l.s.t.s.s.u.txt == "j"