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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: F = None
        self.txt = txt

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

h = A("h")
m = B("m")
b = C("b")
l = D("l")
i = E("i")
j = F("j")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: F = None
        self.txt = txt

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

h = A("h")
m = B("m")
b = C("b")
l = D("l")
i = E("i")
j = F("j")

h.o = j
h.y = l
h.u = i
h.z = i
h.r = i
m.s = h
m.t = b
m.v = l
m.x = i
b.o = l
b.w = j
l.y = h
l.z = h
l.r = b
l.q = i
i.z = b
i.q = j
j.w = h
j.r = h
j.q = h
assert m.v.q.q.q.z.z.txt == "b"