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

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

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

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

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

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

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

l.t = j
l.s = j
l.w = i
l.r = i
f.q = c
i.o = j
i.s = j
i.t = f
b.s = i
c.o = j
c.s = l
c.p = i
j.s = f
j.r = b
assert i.o.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: F = None
        self.w: C = None
        self.r: C = None
        self.txt = txt

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

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

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

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

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

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

l.t = j
l.s = j
l.w = i
l.r = i
f.q = c
i.o = j
i.s = j
i.t = f
b.s = i
c.o = j
c.s = l
c.p = i
j.s = f
j.r = b
assert i.o.s.q.txt == "c"