class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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

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

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

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

f = A("f")
i = B("i")
e = C("e")
b = D("b")
m = E("m")
h = F("h")
d = F("d")
j = D("j")

f.q = d
i.t = b
e.u = i
e.o = i
e.y = f
e.r = f
e.z = d
b.y = d
b.u = d
b.s = i
b.r = i
b.q = e
m.r = b
m.y = i
m.z = h
h.z = i
d.z = i
j.y = h
j.u = h
j.s = i
j.r = i
j.q = e
assert m.y.t.r.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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

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

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

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

f = A("f")
i = B("i")
e = C("e")
b = D("b")
m = E("m")
h = F("h")
d = F("d")
j = D("j")

f.q = d
i.t = b
e.u = i
e.o = i
e.y = f
e.r = f
e.z = d
b.y = d
b.u = d
b.s = i
b.r = i
b.q = e
m.r = b
m.y = i
m.z = h
h.z = i
d.z = i
j.y = h
j.u = h
j.s = i
j.r = i
j.q = e
assert m.y.t.r.t.q.txt == "e"