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

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

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

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

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

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

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

f.q = c
f.w = h
f.o = h
f.r = l
f.v = e
h.o = c
h.y = f
j.w = m
j.u = m
l.t = m
c.r = m
e.r = h
e.u = h
e.q = j
e.v = m
e.s = f
m.t = l
n.w = m
n.u = l
i.q = c
i.w = h
i.o = h
i.r = l
i.v = e
assert j.w.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: B = None
        self.o: B = None
        self.r: D = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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

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

f.q = c
f.w = h
f.o = h
f.r = l
f.v = e
h.o = c
h.y = f
j.w = m
j.u = m
l.t = m
c.r = m
e.r = h
e.u = h
e.q = j
e.v = m
e.s = f
m.t = l
n.w = m
n.u = l
i.q = c
i.w = h
i.o = h
i.r = l
i.v = e
assert j.w.t.t.txt == "m"